open2315125 = ''
close = 0
flag = True
s = input() #()))()()(()() [][] ([]) -> 6; 7
for el in s:
    if el == '(' or el == '[' or el == '{' or el == '<':
        open2315125 += el
    elif el == ')':
        if open2315125:
            if open2315125[-1] == '(':
                open2315125 = open2315125[:-1]
        else:
            flag = False
    
    elif el == ']':
        if open2315125:
            if open2315125[-1] == '[':
                open2315125 = open2315125[:-1]
        else:
            flag = False
            
    elif el == '}':
        if open2315125:
            if open2315125[-1] == '{':
                open2315125 = open2315125[:-1]
        else:
            flag = False
    
    elif el == '>':
        if open2315125:
            if open2315125[-1] == '<':
                open2315125 = open2315125[:-1]
        else:
            flag = False
            
if len(open2315125) > 0 or not flag:
    print('Неверная')
elif flag == False:
    print('Неверная')
else:
    print('Верная')